<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="{{ lang }}"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang="{{ lang }}"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" lang="{{ lang }}"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="{{ lang }}"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>Gridlock Exchange{% if title %} | {{ title }}{% endif %}</title>
        <meta name="description" content="{{ title }}">
        <meta name="viewport" content="width=device-width">
        <link rel="stylesheet" href="/static/css/lib.min.css">
        <link rel="stylesheet" href="/static/css/app.min.css">
        <script src="/static/js/vendor/modernizr-2.6.2.min.js"></script>
    </head>
    <body>
        <!--[if lt IE 7]>
            <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
        <![endif]-->

        {% include "navbar.fragment.html" %}

        <div class="loader" style="text-align: center; padding: 1em; display: none;">
            <div class="icon-cog icon-4x icon-spin"></div>
        </div>

        <div class="alert alert-error fade in jqload-error" style="display:none;">
            <strong>Error:</strong> Sorry, but the page you requested could not be loaded. Please try again later.
        </div>

        <div class="content">
            {% with messages = get_flashed_messages(with_categories=True) %}
                {% for category, message in messages %}
                    {% if category == "message" %}
                        <div class="alert alert-info fade in">
                    {% else %}
                        <div class="alert alert-{{ category }} fade in">
                    {% endif %}
                            <button type="button" class="close" data-dismiss="alert">&times;</button>
                            {{ message }}
                        </div>
                {% endfor %}
            {% endwith %}

            {% block content %}
            {% endblock %}
            <script type="text/javascript">
                var _gaq=_gaq||[];
                {% if config.GA_ID %}
                    {# Global tracking for our app. #}
                    _gaq.push(['_setAccount','{{ ga_id }}']);
                    _gaq.push(['_trackPageview']);
                {% endif %}
                {% if user_track %}
                    _gaq.push(['ut._setAccount','{{ user_track }}']);
                    _gaq.push(['ut._trackPageview']);
                {% endif %}
            </script>
            {# Hack to allow tracking even on dynamic loads. #}
            {% if user_track %}
                <div gaid="{{ user_track }}"></div>
            {% endif %}
            <div id="dlv" title="Gridlock Exchange{% if title %} | {{ title }}{% endif %}"></div>
        </div>

        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
        <script>window.jQuery || document.write('<script src="/static/js/vendor/jquery-1.9.0.min.js"><\/script>')</script>
        <script src="/static/js/app.js"></script>

        <script>
            (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
            g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
            s.parentNode.insertBefore(g,s)}(document,'script'));
        </script>
        <script type="text/javascript">
        window.___gcfg = {lang: 'en-GB'};

        (function() {
            var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
            po.src = 'https://apis.google.com/js/plusone.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
        })();
        </script>
    </body>
</html>
